#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <iostream>
#include <memory>
#include <QHostAddress>
#include "qmqtt.h"
#include "QTimer"
namespace Ui {
class MainWindow;
}

#define QOS 2

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

    void onConnected();
    void onSubscribed(const QString &topic);
    void onUnSubscribed(const QString &topic);
    void onPublished(const QMQTT::Message& message);
    void onReceived(const QMQTT::Message& message);
    void on_Btn_Connect_clicked();
    void on_Btn_Subscib_clicked();

    void on_Btn_Publish_clicked();

    void on_Btn_ClearText_clicked();

private:
    Ui::MainWindow *ui;
    QMQTT::Client * m_pClient;
    QTimer *m_connectTime;

};

#endif // MAINWINDOW_H
